<template>
    <text :style="style" :x="x" :y="y" :fill="fill">
      <template v-if="tSpan.length > 0">
        <tspan
          v-for="(span, j) in tSpan"
          :key="j"
          :x="span.x"
          :dy="span.dy"
          :style="{
            ...span.style,
            fontWeight: span.text === '|' ? 700 : span.style.fontWeight
          }"
          :fill="span.fill"
        >{{ span.text }}</tspan>
      </template>
      <template v-else>{{ showValue }}</template>
    </text>
  </template>
  
  <script setup>
  const props = defineProps({
    style: Object,
    x: [String, Number],
    y: [String, Number],
    fill: String,
    tSpan: Array,
    showValue: [String, Number],
  });
  </script>